package cate.common.table.pvp.arena.opponent_range;

import cate.common.table.EExcelNoteField;
import cate.common.table.EExcelRowClass;
import cate.common.table.ERow;
import easy.java.dev.note.NoteField;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@EExcelRowClass(note = "跨服擂台赛-跨服擂台赛对手区间")
public class ArenaOpponentRangeRow extends ERow {
    @EExcelNoteField(fieldName = "名次开始")
    public int rankStart;
    @EExcelNoteField(fieldName = "名次结束")
    public int rankEnd;
    @EExcelNoteField(fieldName = "对手区间")
    public String rangeStr;

    @NoteField("向前区间")
    public int forwardRange;
    @NoteField("向后区间")
    public int backwardRange;

    @Override
    public void decode() {
        super.decode();
        try {
            String[] splits = rangeStr.split("_");
            forwardRange = Integer.parseInt(splits[0]);
            backwardRange = Integer.parseInt(splits[1]);
        } catch (Exception e) {
            log.error("", e);
        }
    }
}
